﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="login.ascx.cs" Inherits="account_login" %>
<div id="toppanel">
    <div id="panel">
        <div class="content clearfix">
            <div>
                <!-- Login Form -->
                <asp:LoginView ID="LoginView1" runat="server">
                    <AnonymousTemplate>
                        <h2 style="text-align: center;">
                            Member Login</h2>
                        <asp:Login ID="Login1" runat="server" Font-Names="Verdana" Font-Size="0.8em">
                            <InstructionTextStyle Font-Italic="True" ForeColor="Black" />
                            <LoginButtonStyle BackColor="White" BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px"
                                Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284E98" />
                            <TextBoxStyle Font-Size="0.8em" />
                            <LayoutTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            User name:
                                        </td>
                                        <td rowspan="7">
                                            <asp:Image ID="login_key" runat="server" ImageUrl="~/images/login_key.jpg" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                                Text="*" ValidationGroup="loginForm"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Password:
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                                Text="*" ValidationGroup="loginForm"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me" CssClass="checkbox">
                                            </asp:CheckBox>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Button ID="bt_login" CommandName="Login" runat="server" Text="Login" ValidationGroup="loginForm"
                                                ClientIDMode="Static"></asp:Button>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center">
                                            <asp:Literal ID="FailureText" runat="server"></asp:Literal>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                            </LayoutTemplate>
                        </asp:Login>
                    </AnonymousTemplate>
                    <RoleGroups>
                        <asp:RoleGroup Roles="Admin">
                            <ContentTemplate>
                                <div id="loginauth">
                                    <div id="bubble">
                                        Welcome,<br />
                                        <%=Profile.FirstName %>
                                        <%=Profile.LastName %>(<asp:LoginName ID="LoginName1" runat="server" />
                                        )
                                        <asp:Menu ID="Menu1" runat="server" CssClass="admin-menu">
                                            <Items>
                                                <asp:MenuItem Text="Manage Taxi" NavigateUrl="~/admin/taxi.aspx"></asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/account/profile.aspx" Text="Edit Profile" Value="Edit Profile">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/createUser.aspx" Text="Add User/Driver"></asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/admin/profiles.aspx" Text="Manage Users/Drivers"></asp:MenuItem>
                                                 <asp:MenuItem NavigateUrl="~/admin/report.aspx" Text="Report&Logs"></asp:MenuItem>
                                            </Items>
                                        </asp:Menu>
                                    </div>
                                </div>
                            </ContentTemplate>
                        </asp:RoleGroup>
                        <asp:RoleGroup Roles="Customer">
                               <ContentTemplate>
                                <div id="loginauth-customer">
                                    <div id="bubble">
                                        Welcome,<br />
                                        <%=Profile.FirstName %>
                                        <%=Profile.LastName %>(<asp:LoginName ID="LoginName1" runat="server" />
                                        )
                                        <asp:Menu ID="Menu1" runat="server" CssClass="admin-menu">
                                            <Items>
                                                <asp:MenuItem NavigateUrl="~/account/profile.aspx" Text="Edit Profile" Value="Edit Profile">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl=""></asp:MenuItem>
                                            </Items>
                                        </asp:Menu>
                                    </div>
                                </div>
                            </ContentTemplate>
                        </asp:RoleGroup>
                        <asp:RoleGroup Roles="Driver">
                        <ContentTemplate>
                                <div id="loginauth-driver">
                                    <div id="bubble">
                                        Welcome,<br />
                                        <%=Profile.FirstName %>
                                        <%=Profile.LastName %>(<asp:LoginName ID="LoginName1" runat="server" />
                                        )
                                        <asp:Menu ID="Menu1" runat="server" CssClass="admin-menu">
                                            <Items>
                                                <asp:MenuItem Text="Manage Taxi" NavigateUrl="~/driver/taxi.aspx"></asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/account/profile.aspx" Text="Edit Profile" Value="Edit Profile">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl=""></asp:MenuItem>
                                            </Items>
                                        </asp:Menu>
                                    </div>
                                </div>
                            </ContentTemplate>
                        </asp:RoleGroup>
                    </RoleGroups>
                </asp:LoginView>
            </div>
        </div>
    </div>
    <!-- /login -->
    <!-- The tab on top -->
    <div class="tab">
        <ul class="login">
            <li class="left">&nbsp;</li>
            <li style="width: 112px;" id="usertoggle">
                <% if (Page.User.Identity.IsAuthenticated)
                   { %>
                <a id="useropen" class="open" href="#">
                    <asp:LoginName ID="tabLoginName" runat="server" />
                </a><a id="userclose" style="display: none;" class="close" href="#">Close Panel</a><%}
                   else
                   {%>
                     <a id="createuser" class="thickbox" href="../createUser.aspx">Sign Up</a>
                <%} %>
            </li>
            <li class="sep">|</li>
            <li id="toggle">
                <% if (Page.User.Identity.IsAuthenticated)
                   { %>
                <asp:LoginStatus ID="tabLogout" runat="server" LogoutAction="Redirect" LogoutText="Log Out"
                    LogoutPageUrl="/" CssClass="close" />
                <%}
                   else
                   {%>
                <a id="open" class="open" href="#">Log In</a><%} %>
                <a id="close" style="display: none;" class="close" href="#">Close Panel</a>
            </li>
            <li class="right">&nbsp;</li>
        </ul>
    </div>
    <!-- / top -->
</div>
